package com.itliupeng;

import com.itliupeng.stock.BackendApp;
import com.itliupeng.stock.mapper.StockBusinessMapper;
import com.itliupeng.stock.pojo.entity.StockBusiness;
import com.itliupeng.stock.service.StockService;
import com.itliupeng.stock.service.UserService;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.test.context.support.TestPropertySourceUtils;

import java.util.Date;
import java.util.HashSet;

/**
 * Description:
 * Author:lp
 * Date:2025-04-07
 * Time:19:05
 */

@SpringBootTest(classes = BackendApp.class)
public class test {
    @Autowired
    StockService stockService;
    @Autowired
    PasswordEncoder passwordEncoder;
    @Autowired
    UserService userService;
    @Test
    public void test() {
        String pwd="123456";
        String encode=passwordEncoder.encode(pwd);
        System.out.println(encode);
    }

    @Autowired
    StockBusinessMapper stockBusinessMapper;
    @Test
    public void test1() {

    }

    @Test
    public void te(){
       /* String a="aaa";
        String b=new String("aaa");
        System.out.println(a==b);*/
        /*stockService.stockCreenDkLine("600016");*/
        StockBusiness pojo = StockBusiness.builder().stockCode("90000")
                .stockName("900000")
                .blockLabel("900000")
                .blockName("900000")
                .business("900000")
                .updateTime(new Date())
                .build();
        stockBusinessMapper.insert(pojo);

        System.out.println(DateTime.now().withDayOfWeek(1).toString(DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss")));
    }

    @Test
    public void test8() {
        String str="1";
        String str2=new String("1");
        System.out.println(str.equals(str));
        HashSet<String> objects = new HashSet<>();
        objects.add(str);
        objects.add(str2);
        System.out.println(objects.toString());


    }
}
